package com.easipass.framework.eirframeworkjdbc.model;

import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Id;
import javax.persistence.Transient;
import java.time.LocalDateTime;

@Document
public class MessageLog {
    @Id
    private String id;
    private String name;
    private Object content;
    private String serviceName;
    private String appName;
    @Transient
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    public MessageLog() {

    }

    public MessageLog(String id, String name, Object content, String serviceName, String appName, LocalDateTime createTime) {
        this.id = id;
        this.name = name;
        this.content = content;
        this.serviceName = serviceName;
        this.appName = appName;
        this.createTime = createTime;
    }

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Object getContent() {
        return content;
    }

    public void setContent(Object content) {
        this.content = content;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    @Override
    public String toString() {
        return "MessageLog{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", content=" + content +
                ", serviceName='" + serviceName + '\'' +
                ", appName='" + appName + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}
